//-----------------------------------------------------
// nguimanager.cpp
//-----------------------------------------------------

/**
 * @file nguimanager.cpp
 */

#include "nguimanager.h"
#include "application/ngfxobject.h"

namespace nebulaGUI {

	NGUIManager::NGUIManager(): _scene(0)/*, _player(0)*/ 
	{
		//_entities = new NGUIEntities();
	}

	NGUIManager::~NGUIManager()
	{
		//if (_entities)
		//	delete _entities;
	}

	void NGUIManager::staticEntityCreated(const logic::ILogicFacade *facade/*, CStaticEntity *staticEntity*/)
	{
		//NGUIStaticEntity *staticEntity =  new NGUIStaticEntity();
		//if (staticEntity->setResource("gfxlib:proyectiles\\prueba.n2"))
		//{
		//	staticEntity->LoadResource();
		//	staticEntity->setLogicEntity(CEntity);
		//	_entities->insertEntity(staticEntity);

		//}
	}

	bool NGUIManager::initScene(const char *n2File)
	{
		if (!_scene)
		{
			_scene = new nGfxObject();
			_scene->SetResourceName(n2File);

			return _scene->Load();
		}
		else
			return false;
	}

	void NGUIManager::endScene()
	{
		if (_scene)
		{
			_scene->Unload();
			delete _scene;
		}

	}

	void NGUIManager::renderScene()
	{
		if (_scene)
			_scene->Render();
	}

	void NGUIManager::renderEntities()
	{
		//_entities->render();
	}

	void NGUIManager::cleanEntities()
	{
		// TODO: It must clean NGUIEntities
	}

} // namespace nebulaGUI*/
